package bjtuoj;

import java.util.Scanner;

/**
 * ClassName: Homework_2_C
 * Description:
 * date: 2021-10-14 10:14
 *
 * @author liyifan
 */
public class Homework_2_C {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        double n = scanner.nextDouble();
        scanner.close();
        while (n > 18.0)
            n /= 18.0;
        if (n <= 9.0)
            System.out.print("181818181818");
        else
            System.out.print("ZBT");
    }
}
